$(function(){
    $('.zhanshi-toop').on('mouseenter', 'span', function(event) {
        $(this).addClass('zhanshi-toop-active');
        $(this).siblings('span').removeClass('zhanshi-toop-active');
        var $index = $(this).index();             
        if ($index == 0) {  
          $('#gla2').show();
          $('#gla').hide();
          $('#gla3').hide();
          $('.zhanshi-text2').show();
          $('.zhanshi-text1').hide();
          $('.zhanshi-text3').hide();
        }else if($index == 1){
          $('#gla').show();
          $('#gla2').hide();
          $('#gla3').hide();
          $('.zhanshi-text2').hide();
          $('.zhanshi-text1').show();
          $('.zhanshi-text3').hide();
        }else if ($index == 2){
          $('#gla3').show();
          $('#gla2').hide();
          $('#gla').hide();
          $('.zhanshi-text2').hide();
          $('.zhanshi-text1').hide();
          $('.zhanshi-text3').show();
        }
    });
   

    //3d旋转
    if($('#gla')){
        $('.gla_inbox').corner('0px');
        $('#gla_box>ul').roundabout({
            minOpacity:1,
            btnNext: ".next",
            duration: 800,
            reflect: true,
            btnPrev: '.prev',
            autoplay:true,
            autoplayDuration:'999999999',
            tilt:0,
            shape: 'figure8'
        });
    }
    if($('#gla2')){
        $('.gla_inbox').corner('0px');
        $('#gla_box2>ul').roundabout({
            minOpacity:1,
            btnNext: ".next",
            duration: 800,
            reflect: true,
            btnPrev: '.prev',
            autoplay:true,
            autoplayDuration:'999999999',
            tilt:0,
            shape: 'figure8'
        });
    }
    if($('#gla3')){
        $('.gla_inbox').corner('0px');
        $('#gla_box3>ul').roundabout({
            minOpacity:1,
            btnNext: ".next",
            duration: 800,
            reflect: true,
            btnPrev: '.prev',
            autoplay:true,
            autoplayDuration:'999999999',
            tilt:0,
            shape: 'figure8'
        });
    }

    //锚点点击对应
    $('#mao').on('click', 'li', function(event) {
        event.preventDefault();
        /* Act on the event */
        var index = $(this).index();
        if (index == 0) {
            $('body').animate({scrollTop:0},200); 
        }else if (index == 1) {
            $('body').animate({scrollTop:($(".chanping").offset().top-80)},500); 
        }else if (index == 2) {
            $('body').animate({scrollTop:($(".jsys").offset().top-80)},500); 
        }else if (index == 3) {
            $('body').animate({scrollTop:($(".cpjg").offset().top-80)},500); 
        }else if (index == 4) {
            $('body').animate({scrollTop:($(".hzlx").offset().top-80)},500); 
        }
    });
    $('#ljcpBth').on('click', function(event) {
        event.preventDefault();
        /* Act on the event */
        $('body').animate({scrollTop:($(".chanping").offset().top)},500); 
    });
    
    //滚动
    $(window).scroll(function(){
        var s=$(window).scrollTop();
        if(s > 80){
            $('.logoBox').addClass('logoBox-fixed');
        }
        if(s == 0){
            $('.logoBox').removeClass('logoBox-fixed');
        }
    });
});